package com.gxuwz.prrs.config;

import com.gxuwz.prrs.interceptor.RequestInterceptor;
import okhttp3.OkHttpClient;

import java.util.concurrent.TimeUnit;

/**
 * @author 张钧
 * @Description
 * @create 2023-05-24 上午 08:58
 */
public class OkHttpClientConfiguration {

	public static OkHttpClient getOkHttpClient() {
		OkHttpClient.Builder httpClientBuilder = new OkHttpClient.Builder();
		httpClientBuilder.connectTimeout(3000, TimeUnit.SECONDS);
		httpClientBuilder.writeTimeout(3000, TimeUnit.SECONDS);
		httpClientBuilder.readTimeout(3000, TimeUnit.SECONDS);
		httpClientBuilder.addInterceptor(new RequestInterceptor());
		return httpClientBuilder.build();
	}
}
